

var modeBox= document.getElementById("modeBox");
var modeImg = document.getElementById("modeImg");
function modelClick(e) {
    modeBox.style.zIndex = "10";
    modeBox.style.opacity = "1";
    zzmp(e);

    document.onclick= function () {
        modeBox.style.zIndex = "-1";
        modeBox.style.opacity = "0";
    };
    
    document.getElementById("modeImg").onclick= function (e) {
        zzmp(e);
    };
}
function zzmp(e){
    if (e && e.stopPropagation) {
        e.stopPropagation();
    } else {
        window.event.cancelBubble = true;
    }
}

/*modeImg.onclick= function (e) {
    zzmp(e)
};*/


$(function () {
    var html = document.querySelector('html'),
        rem = html.offsetWidth / 6.4,
        hei = $(".rightBox>div:last-child").height() / rem;

    if ($(".rightBox>div:last-child").height() / rem > 1.2) {
        $(".rightBox").append("<button class='ShowBtnTotle'>展开</NOtton>");
        $(".rightBox>div:nth-child(2)").addClass("addS");
        var nHei = $(".addS").height()/rem;
    }
        $(".ShowBtnTotle").click(function () {
            if ($(".ShowBtnTotle").text()=="展开"){
                $(".ShowBtnTotle").text("隐藏");
                $(".rightBox>div:nth-child(2)").removeClass("addS");
                $(".rightBox>div:nth-child(2)").css({
                    height: hei + 0.15 + "rem"
                })
            }else {

                $(".ShowBtnTotle").text("展开")
                $(".rightBox>div:nth-child(2)").addClass("addS");
                $(".rightBox>div:nth-child(2)").css({
                    height:  nHei+ 0.15 + "rem"
                })
            }
        })
});
